<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateUploadFileTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('upload_file', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->string('local_url')->default('')->comment('本地url地址');
            $table->string('remote_url')->default('')->comment('远程url地址');
            $table->string('md5_value')->default('')->comment('文件md5值');
            $table->string('ext')->default('')->comment('文件后缀');
            $table->integer('user_id')->default(0)->comment('用户id');
            $table->integer('type')->default(0)->comment('1:api2:admin');
            $table->integer('status')->default(0)->comment('0禁用1启用');
            $table->timestamps();
            $table->softDeletes();
        });
        \Illuminate\Support\Facades\DB::statement("ALTER TABLE `upload_file` comment '图库表'");
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('upload_file');
    }
}
